package com.orangelife.mobile.point.biz;

import android.os.Handler;

import com.curry.android.http.HttpUtil;
import com.curry.android.http.VolleyHttpUtil;
import com.orangelife.mobile.common.biz.JSONRequest;
import com.orangelife.mobile.constants.Constant;

import java.util.HashMap;

/**
 * Created by YangWei
 * on 2016/5/10.
 */
public class MyPointBiz {

    private static final String GET_POINTS = Constant.URL_GET_POINTS;
    private static final String GET_POINTS_DETAIL = Constant.URL_GET_POINTS_DETAIL;
    private static final String GET_DEDUCTION = Constant.URL_GET_DEDUCTION;
    public static final int POINTS_DETAIL = 111;
    public static final int DEDUCTION = 222;

    /**
     * 查询用户积分
     *
     * @param callBack
     */
    public static void getMyPoints(VolleyHttpUtil.ResponseCallBack callBack) {
        VolleyHttpUtil.getInstance().getWithCallback(GET_POINTS, callBack);
    }

    /**
     * 获取积分明细
     *
     * @param map
     * @param handler
     */
    public static void getMyPointsDetail(HashMap<String, String> map, Handler handler) {
        VolleyHttpUtil.getInstance().getWithHandler(GET_POINTS_DETAIL, handler, POINTS_DETAIL, map);
    }

    /**
     * 获取抵扣积分
     *
     * @param map
     * @param handler
     */
    public static void getDeduction(HashMap<String, Object> map, Handler handler) {
        VolleyHttpUtil.getInstance().postWithHandler(GET_DEDUCTION, map, handler, DEDUCTION);
    }

    public static void getDeduction(HashMap<String, Object> map, VolleyHttpUtil.ResponseCallBack callBack) {
        VolleyHttpUtil.getInstance().postWithCallback(GET_DEDUCTION, map, callBack);
    }


}
